//
//  LcLocationClient.h
//  18Birdies
//
//  Created by weihua on 2017/6/26.
//  Copyright © 2017年 Lc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

@protocol LcLocationClientDelegate<NSObject>
@optional
- (void)onLocationChanged:(CLLocation*)location;
- (void)onHeadingChanged:(CLHeading*)heading;
- (void)onLocationAuthorizedChanged:(BOOL)authorized;
@end

@interface LcLocationClient : NSObject

+ (instancetype)client;

/**
 * Check app locationEnabled
 */
@property(nonatomic, assign, readonly) BOOL locationEnabled;
@property(nonatomic, assign, readonly) BOOL authorized;
@property(nonatomic, assign, readonly) BOOL authorizationNotDetermined;

/**
 * client using gps
 */
@property(nonatomic, assign, readonly) BOOL usingGps;

// 使用高精度模式
@property(nonatomic, assign) BOOL useHighAccuracyMode;

// 只获取一次就停止获取----只对location有效，对heading无效
// 功能类似ios9.0的requestLocation函数
@property(nonatomic, assign) BOOL requestLocationOneTime;

@property(nonatomic, weak) id<LcLocationClientDelegate> delegate;

//- (void)startUpdating;//location and heading
- (void)stopUpdating;

@property(nonatomic, strong, readonly) CLLocation* lastKnownLocation;
@property(nonatomic, assign, readonly) BOOL updatingLocation;
- (void)startUpdatingLocation;
- (void)stopUpdatingLocation;

@property(nonatomic, strong, readonly) CLHeading* lastKnownHeading;
@property(nonatomic, assign, readonly) BOOL updatingHeading;
- (void)startUpdatingHeading;
- (void)stopUpdatingHeeading;

- (void)pause;
- (void)resume;

@end
